//
//  SyncHandlerGetAlumnoInfo.m
//  MasterUabApp
//
//  Created by Developer on 14/10/13.
//  Copyright (c) 2013 Owlab. All rights reserved.
//

//----IMPORTS-->
#import "SyncHandlerGetAlumnoInfo.h"
#import "EConsts.h"
#import "ECommon.h"
#import "Alumno.h"
//<-------------

@implementation SyncHandlerGetAlumnoInfo


- (int) getType
{
    return SYNC_HANDLER_TYPE_NONE;
}

- (NSString*) getMethod
{
    return @"services.php?detalleAlumno";
}

- (void) fillRequestParams:(NSMutableDictionary*)data
{
    [super fillRequestParams:data];
    [data setValue:_AlumnoID    forKey:@"id"];
}

- (BOOL) processJSON:(id)data;
{
    BOOL ok = YES;
    
    AlumnoArray *l_alumno = (AlumnoArray*)self.delegate;
    NSArray*arr = (NSArray*)data;
    NSDictionary *objData = [arr objectAtIndex:0];
    l_alumno.alumno = [[Alumno alloc]init];
    l_alumno.alumno.AlumnoNombre    =   [self stringFromJSON:[objData objectForKey:@"AlumnoNombre"]];
    l_alumno.alumno.AlumnoApellidos =   [self stringFromJSON:[objData objectForKey:@"AlumnoApellidos"]];
    l_alumno.alumno.AlumnoNIF       =   [self stringFromJSON:[objData objectForKey:@"AlumnoNIF"]];
    
    [self syncDone:YES object:l_alumno];
    
    return ok;
}

@end
